<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title></title>
    <link rel="stylesheet" href="{$Assets}layui/css/layui.css">
    <script type="text/javascript" src="{$Assets}aikenjs/jquery.js"></script>
</head>
<body>
    <div style="height: 50px;line-height: 50px;background: #fff;padding-left: 20px;font-size: 20px;font-family: microsoft yahei;margin-bottom: 10px;">
 

                <a href="javascript:void(0)" id="layerDemo" style="color: #333;font-family: microsoft yahei;float: right;margin-right: 25px;font-size: 14px;">{$user}
                    <button data-method="confirmTrans" class="layui-btn" style="background-color: #009688;">/button>
                </a>
    </div>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend></legend>
</fieldset>

<form class="layui-form" action="">
    <div class="layui-form-item" >
        <input type="hidden" name="UserID" value="{$userinfo.UserID}">
        <label class="layui-form-label">*)</label>
        <div class="layui-input-inline">
            <input type="text" name="UserName" value="{$userinfo.UserName}" placeholder=" autocomplete="off" class="layui-input" disabled="">
        </div>
        <label class="layui-form-label">()</label>
        <div class="layui-input-inline">
            <input type="text" name="Passwd" lay-verify="Passwd" placeholder=" autocomplete="off" class="layui-input">
        </div>




    </div>
    <!--
    <div class="layui-form-item" pane="">

        <div class="layui-input-block" style="float:left;margin-left: 52px;">
            <input type="checkbox" name="ChangePass" lay-skin="primary" title=" {if $userinfo.ChangePass=="1"} checked=""{/if}>
        </div>
    </div>
    -->

    <div class="layui-form-item">

        <div class="layui-inline">
            <label class="layui-form-label">/label>
            <div class="layui-input-inline">
                <select name="UserType" lay-verify="required">
                    <option value=""></option>
                    <option value="1" {if $userinfo.UserType==1}selected=""{/if}>/option>
                    <option value="2" {if $userinfo.UserType==2}selected=""{/if}></option>
                </select>
            </div>
        </div>

    </div>





    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="addcar"></button>
            <button type="reset" class="layui-btn layui-btn-primary"></button>
        </div>
    </div>

</form>










<script src="{$Assets}layui/layui.js?t=1515376178709"></script>
<script>
    layui.use(['form', 'layedit', 'laydate'], function(){
        var form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,laydate = layui.laydate;

        //
        laydate.render({
            elem: '#date'
        });
        laydate.render({
            elem: '#date1'
        });

        //
        var editIndex = layedit.build('LAY_demo_editor');

        //
        form.verify({
            title: function(value){
                if(value.length < 5){
                    return '';
                }
            }
            ,pass: [/(.+){6,12}$/, '62]
            ,content: function(value){
                layedit.sync(editIndex);
            }
        });

        //
        form.on('switch(switchTest)', function(data){
            layer.msg('checked+ (this.checked ? 'true' : 'false'), {
                offset: '6px'
            });
            layer.tips('ON|OFF', data.othis)
        });

        //
        form.on('submit(addcar)', function(data){

            var sdata=JSON.stringify(data.field);
            $.ajax({
                type:"POST",
                url: "saveuser",
                data:{sdata:sdata},
                dataType:"json",

                success:function(datas){
                    //alert(sdata);
                    //layer.msg(datas);

                    if(datas=='1'){
                        layer.msg('!');
                        setTimeout(function(){  //  setTimeout2000
                            self.location='/index.php/admin/user/index.html';
                        },500);
                    }else{
                        layer.msg('!');
                        setTimeout(function(){  //  setTimeout2000
                            self.location='/index.php/admin/user/index.html';
                        },1000);
                    }
                }
            });

            return false;
        });


    });
</script>

<script>
    layui.use('layer', function(){ //layer
        var $ = layui.jquery, layer = layui.layer; //layer

        //
        var active = {
            confirmTrans: function(){

                $.ajax({
                    type:"POST",
                    url: "../index/loginout",
                    dataType:"text",
                    success:function(datas){
                        //layer.msg(datas);
                        if(datas==1){
                            layer.msg('');
                            setTimeout(parent.location.reload(),1000);
                        }
                    }
                });

            }
        };

        $('#layerDemo .layui-btn').on('click', function(){
            var othis = $(this), method = othis.data('method');
            active[method] ? active[method].call(this, othis) : '';
        });

    });
</script>


{include file="public/footer"/}
</body>
</html>
